package com.tedu.springdemo.day04;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

//典型的实例工厂
//@Bean 注解 用于方法上，返回对象


@Component
public class NetConnInstanceFactory {
    @Bean("nc")
    public NetCnnection getInstance(){
        NetCnnection nc=new NetCnnection();
        nc.load();nc.ping();nc.conn();
        return nc;
    }
}